/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package VIRTUAL;

import bdd.Otros.LOGIN;
import com.sun.awt.AWTUtilities;
import java.awt.Image;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

public class SPLASH extends javax.swing.JFrame implements Runnable {
Thread t;
ResultSet r;
conexion con=new conexion();

    public SPLASH() {
            setUndecorated(true);
            setResizable(false);
            AWTUtilities.setWindowOpaque(this, false);
            initComponents();
    ImageIcon IconAux=new ImageIcon(getClass().getResource("/imagenes/Log_completo.png"));
    ImageIcon temp=new ImageIcon(IconAux.getImage().getScaledInstance(jLabel1.getWidth(),jLabel1.getHeight(),Image.SCALE_DEFAULT));
    jLabel1.setIcon(temp);
    }

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        progreso = new javax.swing.JProgressBar();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        progreso.setForeground(new java.awt.Color(255, 153, 0));
        progreso.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 0, true));
        progreso.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
        getContentPane().add(progreso, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 410, 270, 40));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/Log_completo.png"))); // NOI18N
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 10, 510, 450));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    public static void main(String args[]) {
       
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SPLASH().setVisible(false);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JProgressBar progreso;
    // End of variables declaration//GEN-END:variables

    @Override
    public void run() {
             LOGIN2 log = new LOGIN2();
              this.setLocationRelativeTo(null);
            this.setVisible(true); 
            try {
           for(int i=0;i<100;i++){
               progreso.setValue(i);
                  t.sleep(50);
           }
           } catch (InterruptedException ex) {
          JOptionPane.showMessageDialog(null, ex);
           }
      
            log.setVisible(true);
            dispose();
    }
}
